<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE BangPatterns, CPP, FlexibleInstances, KindSignatures,
    ScopedTypeVariables, TypeOperators, TypeSynonymInstances #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE Safe #-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# OPTIONS_GHC -fno-warn-orphans #-}</span><span class="hs-cpp">

#if __GLASGOW_HASKELL__ &gt;= 800
</span><span class="hs-cpp">#define HAS_DATA_KIND
</span><span class="hs-cpp">#endif
</span><span>
</span><span id="line-10"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Module      : Data.Binary.Generic</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- Copyright   : Bryan O'Sullivan</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- License     : BSD3-style (see LICENSE)</span><span>
</span><span id="line-15"></span><span class="hs-comment">--</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- Maintainer  : Bryan O'Sullivan &lt;bos@serpentine.com&gt;</span><span>
</span><span id="line-17"></span><span class="hs-comment">-- Stability   : unstable</span><span>
</span><span id="line-18"></span><span class="hs-comment">-- Portability : Only works with GHC 7.2 and newer</span><span>
</span><span id="line-19"></span><span class="hs-comment">--</span><span>
</span><span id="line-20"></span><span class="hs-comment">-- Instances for supporting GHC generics.</span><span>
</span><span id="line-21"></span><span class="hs-comment">--</span><span>
</span><span id="line-22"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-23"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Data.Binary.Generic</span><span>
</span><span id="line-24"></span><span>    </span><span class="hs-special">(</span><span>
</span><span id="line-25"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-26"></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Applicative.html#"><span class="hs-identifier">Control.Applicative</span></a></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Binary.Class.html"><span class="hs-identifier">Data.Binary.Class</span></a></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Binary.Get.html"><span class="hs-identifier">Data.Binary.Get</span></a></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Binary.Put.html"><span class="hs-identifier">Data.Binary.Put</span></a></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Bits.html#"><span class="hs-identifier">Data.Bits</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Word.html#"><span class="hs-identifier">Data.Word</span></a></span><span class="hs-cpp">
#if !MIN_VERSION_base(4,11,0)
</span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Data.Monoid</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-operator">&lt;&gt;</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span><span class="hs-cpp">#ifdef HAS_DATA_KIND
</span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Kind.html#"><span class="hs-identifier">Data.Kind</span></a></span><span class="hs-cpp">
#endif
</span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/GHC.Generics.html#"><span class="hs-identifier">GHC.Generics</span></a></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span> </span><span class="hs-comment">-- Silence AMP warning.</span><span>
</span><span id="line-41"></span><span>
</span><span id="line-42"></span><span class="hs-comment">-- Type without constructors</span><span>
</span><span id="line-43"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Data.Binary.Class.html#GBinaryPut"><span class="hs-identifier hs-type">GBinaryPut</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Generics.html#V1"><span class="hs-identifier hs-type">V1</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-44"></span><span>    </span><span id="local-6989586621679058964"><span class="annot"><span class="annottext">gput :: forall t. V1 t -&gt; Put
</span><a href="Data.Binary.Class.html#gput"><span class="hs-identifier hs-var hs-var hs-var hs-var">gput</span></a></span></span><span> </span><span class="annot"><span class="annottext">V1 t
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; Put
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-45"></span><span>
</span><span id="line-46"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Data.Binary.Class.html#GBinaryGet"><span class="hs-identifier hs-type">GBinaryGet</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Generics.html#V1"><span class="hs-identifier hs-type">V1</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-47"></span><span>    </span><span id="local-6989586621679058955"><span class="annot"><span class="annottext">gget :: forall t. Get (V1 t)
</span><a href="Data.Binary.Class.html#gget"><span class="hs-identifier hs-var hs-var hs-var hs-var">gget</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">V1 t -&gt; Get (V1 t)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">V1 t
forall a. HasCallStack =&gt; a
</span><a href="../../base/src/GHC.Err.html#undefined"><span class="hs-identifier hs-var">undefined</span></a></span><span>
</span><span id="line-48"></span><span>
</span><span id="line-49"></span><span class="hs-comment">-- Constructor without arguments</span><span>
</span><span id="line-50"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Data.Binary.Class.html#GBinaryPut"><span class="hs-identifier hs-type">GBinaryPut</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Generics.html#U1"><span class="hs-identifier hs-type">U1</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-51"></span><span>    </span><span id="local-6989586621679058949"><span class="annot"><span class="annottext">gput :: forall t. U1 t -&gt; Put
</span><a href="#local-6989586621679058949"><span class="hs-identifier hs-var hs-var hs-var hs-var">gput</span></a></span></span><span> </span><span class="annot"><span class="annottext">U1 t
</span><a href="../../base/src/GHC.Generics.html#U1"><span class="hs-identifier hs-var">U1</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; Put
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-52"></span><span>
</span><span id="line-53"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Data.Binary.Class.html#GBinaryGet"><span class="hs-identifier hs-type">GBinaryGet</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Generics.html#U1"><span class="hs-identifier hs-type">U1</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-54"></span><span>    </span><span id="local-6989586621679058944"><span class="annot"><span class="annottext">gget :: forall t. Get (U1 t)
</span><a href="#local-6989586621679058944"><span class="hs-identifier hs-var hs-var hs-var hs-var">gget</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">U1 t -&gt; Get (U1 t)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">U1 t
forall k (p :: k). U1 p
</span><a href="../../base/src/GHC.Generics.html#U1"><span class="hs-identifier hs-var">U1</span></a></span><span>
</span><span id="line-55"></span><span>
</span><span id="line-56"></span><span class="hs-comment">-- Product: constructor with parameters</span><span>
</span><span id="line-57"></span><span id="local-6989586621679059123"><span id="local-6989586621679059124"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Binary.Class.html#GBinaryPut"><span class="hs-identifier hs-type">GBinaryPut</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059124"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Class.html#GBinaryPut"><span class="hs-identifier hs-type">GBinaryPut</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059123"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Class.html#GBinaryPut"><span class="hs-identifier hs-type">GBinaryPut</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679059124"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Generics.html#%3A%2A%3A"><span class="hs-operator hs-type">:*:</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059123"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-58"></span><span>    </span><span id="local-6989586621679058935"><span class="annot"><span class="annottext">gput :: forall t. (:*:) a b t -&gt; Put
</span><a href="#local-6989586621679058935"><span class="hs-identifier hs-var hs-var hs-var hs-var">gput</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679058934"><span class="annot"><span class="annottext">a t
</span><a href="#local-6989586621679058934"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Generics.html#%3A%2A%3A"><span class="hs-operator hs-type">:*:</span></a></span><span> </span><span id="local-6989586621679058932"><span class="annot"><span class="annottext">b t
</span><a href="#local-6989586621679058932"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a t -&gt; Put
forall {k} (f :: k -&gt; *) (t :: k). GBinaryPut f =&gt; f t -&gt; Put
</span><a href="Data.Binary.Class.html#gput"><span class="hs-identifier hs-var">gput</span></a></span><span> </span><span class="annot"><span class="annottext">a t
</span><a href="#local-6989586621679058934"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Put -&gt; Put -&gt; Put
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">b t -&gt; Put
forall {k} (f :: k -&gt; *) (t :: k). GBinaryPut f =&gt; f t -&gt; Put
</span><a href="Data.Binary.Class.html#gput"><span class="hs-identifier hs-var">gput</span></a></span><span> </span><span class="annot"><span class="annottext">b t
</span><a href="#local-6989586621679058932"><span class="hs-identifier hs-var">y</span></a></span></span></span><span>
</span><span id="line-59"></span><span>
</span><span id="line-60"></span><span id="local-6989586621679059117"><span id="local-6989586621679059118"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Binary.Class.html#GBinaryGet"><span class="hs-identifier hs-type">GBinaryGet</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059118"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Class.html#GBinaryGet"><span class="hs-identifier hs-type">GBinaryGet</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059117"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Class.html#GBinaryGet"><span class="hs-identifier hs-type">GBinaryGet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679059118"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Generics.html#%3A%2A%3A"><span class="hs-operator hs-type">:*:</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059117"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-61"></span><span>    </span><span id="local-6989586621679058921"><span class="annot"><span class="annottext">gget :: forall t. Get ((:*:) a b t)
</span><a href="#local-6989586621679058921"><span class="hs-identifier hs-var hs-var hs-var hs-var">gget</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a t -&gt; b t -&gt; (:*:) a b t
forall k (f :: k -&gt; *) (g :: k -&gt; *) (p :: k).
f p -&gt; g p -&gt; (:*:) f g p
</span><a href="../../base/src/GHC.Generics.html#%3A%2A%3A"><span class="hs-operator hs-var">(:*:)</span></a></span><span> </span><span class="annot"><span class="annottext">(a t -&gt; b t -&gt; (:*:) a b t)
-&gt; Get (a t) -&gt; Get (b t -&gt; (:*:) a b t)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Get (a t)
forall {k} (f :: k -&gt; *) (t :: k). GBinaryGet f =&gt; Get (f t)
</span><a href="Data.Binary.Class.html#gget"><span class="hs-identifier hs-var">gget</span></a></span><span> </span><span class="annot"><span class="annottext">Get (b t -&gt; (:*:) a b t) -&gt; Get (b t) -&gt; Get ((:*:) a b t)
forall (f :: * -&gt; *) a b. Applicative f =&gt; f (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var">&lt;*&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Get (b t)
forall {k} (f :: k -&gt; *) (t :: k). GBinaryGet f =&gt; Get (f t)
</span><a href="Data.Binary.Class.html#gget"><span class="hs-identifier hs-var">gget</span></a></span></span></span><span>
</span><span id="line-62"></span><span>
</span><span id="line-63"></span><span class="hs-comment">-- Metadata (constructor name, etc)</span><span>
</span><span id="line-64"></span><span id="local-6989586621679059100"><span id="local-6989586621679059101"><span id="local-6989586621679059102"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Data.Binary.Class.html#GBinaryPut"><span class="hs-identifier hs-type">GBinaryPut</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059102"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Class.html#GBinaryPut"><span class="hs-identifier hs-type">GBinaryPut</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Generics.html#M1"><span class="hs-identifier hs-type">M1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059101"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059100"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059102"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-65"></span><span>    </span><span id="local-6989586621679058915"><span class="annot"><span class="annottext">gput :: forall t. M1 i c a t -&gt; Put
</span><a href="#local-6989586621679058915"><span class="hs-identifier hs-var hs-var hs-var hs-var">gput</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a t -&gt; Put
forall {k} (f :: k -&gt; *) (t :: k). GBinaryPut f =&gt; f t -&gt; Put
</span><a href="Data.Binary.Class.html#gput"><span class="hs-identifier hs-var">gput</span></a></span><span> </span><span class="annot"><span class="annottext">(a t -&gt; Put) -&gt; (M1 i c a t -&gt; a t) -&gt; M1 i c a t -&gt; Put
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">M1 i c a t -&gt; a t
forall k i (c :: Meta) (f :: k -&gt; *) (p :: k). M1 i c f p -&gt; f p
</span><a href="../../base/src/GHC.Generics.html#unM1"><span class="hs-identifier hs-var hs-var">unM1</span></a></span></span></span></span><span>
</span><span id="line-66"></span><span>
</span><span id="line-67"></span><span id="local-6989586621679059085"><span id="local-6989586621679059086"><span id="local-6989586621679059087"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Data.Binary.Class.html#GBinaryGet"><span class="hs-identifier hs-type">GBinaryGet</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059087"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Class.html#GBinaryGet"><span class="hs-identifier hs-type">GBinaryGet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Generics.html#M1"><span class="hs-identifier hs-type">M1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059086"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059085"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059087"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-68"></span><span>    </span><span id="local-6989586621679058907"><span class="annot"><span class="annottext">gget :: forall t. Get (M1 i c a t)
</span><a href="#local-6989586621679058907"><span class="hs-identifier hs-var hs-var hs-var hs-var">gget</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a t -&gt; M1 i c a t
forall k i (c :: Meta) (f :: k -&gt; *) (p :: k). f p -&gt; M1 i c f p
</span><a href="../../base/src/GHC.Generics.html#M1"><span class="hs-identifier hs-var">M1</span></a></span><span> </span><span class="annot"><span class="annottext">(a t -&gt; M1 i c a t) -&gt; Get (a t) -&gt; Get (M1 i c a t)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Get (a t)
forall {k} (f :: k -&gt; *) (t :: k). GBinaryGet f =&gt; Get (f t)
</span><a href="Data.Binary.Class.html#gget"><span class="hs-identifier hs-var">gget</span></a></span></span></span></span><span>
</span><span id="line-69"></span><span>
</span><span id="line-70"></span><span class="hs-comment">-- Constants, additional parameters, and rank-1 recursion</span><span>
</span><span id="line-71"></span><span id="local-6989586621679059074"><span id="local-6989586621679059075"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Data.Binary.Class.html#Binary"><span class="hs-identifier hs-type">Binary</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059075"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Class.html#GBinaryPut"><span class="hs-identifier hs-type">GBinaryPut</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Generics.html#K1"><span class="hs-identifier hs-type">K1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059074"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059075"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-72"></span><span>    </span><span id="local-6989586621679058901"><span class="annot"><span class="annottext">gput :: forall t. K1 i a t -&gt; Put
</span><a href="#local-6989586621679058901"><span class="hs-identifier hs-var hs-var hs-var hs-var">gput</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; Put) -&gt; (K1 i a t -&gt; a) -&gt; K1 i a t -&gt; Put
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">K1 i a t -&gt; a
forall k i c (p :: k). K1 i c p -&gt; c
</span><a href="../../base/src/GHC.Generics.html#unK1"><span class="hs-identifier hs-var hs-var">unK1</span></a></span></span></span><span>
</span><span id="line-73"></span><span>
</span><span id="line-74"></span><span id="local-6989586621679059064"><span id="local-6989586621679059065"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Data.Binary.Class.html#Binary"><span class="hs-identifier hs-type">Binary</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059065"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Class.html#GBinaryGet"><span class="hs-identifier hs-type">GBinaryGet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Generics.html#K1"><span class="hs-identifier hs-type">K1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059064"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059065"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-75"></span><span>    </span><span id="local-6989586621679058893"><span class="annot"><span class="annottext">gget :: forall t. Get (K1 i a t)
</span><a href="#local-6989586621679058893"><span class="hs-identifier hs-var hs-var hs-var hs-var">gget</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; K1 i a t
forall k i c (p :: k). c -&gt; K1 i c p
</span><a href="../../base/src/GHC.Generics.html#K1"><span class="hs-identifier hs-var">K1</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; K1 i a t) -&gt; Get a -&gt; Get (K1 i a t)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Get a
forall t. Binary t =&gt; Get t
</span><a href="Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span></span></span><span>
</span><span id="line-76"></span><span>
</span><span id="line-77"></span><span class="hs-comment">-- Borrowed from the cereal package.</span><span>
</span><span id="line-78"></span><span>
</span><span id="line-79"></span><span class="hs-comment">-- The following GBinary instance for sums has support for serializing</span><span>
</span><span id="line-80"></span><span class="hs-comment">-- types with up to 2^64-1 constructors. It will use the minimal</span><span>
</span><span id="line-81"></span><span class="hs-comment">-- number of bytes needed to encode the constructor. For example when</span><span>
</span><span id="line-82"></span><span class="hs-comment">-- a type has 2^8 constructors or less it will use a single byte to</span><span>
</span><span id="line-83"></span><span class="hs-comment">-- encode the constructor. If it has 2^16 constructors or less it will</span><span>
</span><span id="line-84"></span><span class="hs-comment">-- use two bytes, and so on till 2^64-1.</span><span class="hs-cpp">

#define GUARD(WORD) (size - 1) &lt;= fromIntegral (maxBound :: WORD)
</span><span class="hs-cpp">#define PUTSUM(WORD) GUARD(WORD) = putSum (0 :: WORD) (fromIntegral size)
</span><span class="hs-cpp">#define GETSUM(WORD) GUARD(WORD) = (get :: Get WORD) &gt;&gt;= checkGetSum (fromIntegral size)
</span><span>
</span><span id="line-90"></span><span id="local-6989586621679059053"><span id="local-6989586621679059054"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="Data.Binary.Generic.html#GSumPut"><span class="hs-identifier hs-type">GSumPut</span></a></span><span>  </span><span class="annot"><a href="#local-6989586621679059054"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Generic.html#GSumPut"><span class="hs-identifier hs-type">GSumPut</span></a></span><span>  </span><span class="annot"><a href="#local-6989586621679059053"><span class="hs-identifier hs-type">b</span></a></span><span>
</span><span id="line-91"></span><span>         </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Generic.html#SumSize"><span class="hs-identifier hs-type">SumSize</span></a></span><span>    </span><span class="annot"><a href="#local-6989586621679059054"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Generic.html#SumSize"><span class="hs-identifier hs-type">SumSize</span></a></span><span>    </span><span class="annot"><a href="#local-6989586621679059053"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Class.html#GBinaryPut"><span class="hs-identifier hs-type">GBinaryPut</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679059054"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Generics.html#%3A%2B%3A"><span class="hs-operator hs-type">:+:</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059053"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-92"></span><span>    </span><span id="local-6989586621679058808"><span class="annot"><span class="annottext">gput :: forall t. (:+:) a b t -&gt; Put
</span><a href="#local-6989586621679058808"><span class="hs-identifier hs-var hs-var hs-var hs-var">gput</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">PUTSUM</span><span class="hs-special">(</span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">PUTSUM</span><span class="hs-special">(</span><span class="hs-identifier">Word16</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">PUTSUM</span><span class="hs-special">(</span><span class="hs-identifier">Word32</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">PUTSUM</span><span class="hs-special">(</span><span class="hs-identifier">Word64</span><span class="hs-special">)</span><span>
</span><span id="line-93"></span><span>         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Word64 -&gt; (:+:) a b t -&gt; Put
forall size error. Show size =&gt; String -&gt; size -&gt; error
</span><a href="Data.Binary.Generic.html#sizeError"><span class="hs-identifier hs-var">sizeError</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;encode&quot;</span></span><span> </span><span class="annot"><span class="annottext">Word64
</span><a href="#local-6989586621679058807"><span class="hs-identifier hs-var">size</span></a></span><span>
</span><span id="line-94"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-95"></span><span>        </span><span id="local-6989586621679058807"><span class="annot"><span class="annottext">size :: Word64
</span><a href="#local-6989586621679058807"><span class="hs-identifier hs-var hs-var">size</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Tagged (a :+: b) Word64 -&gt; Word64
forall (s :: * -&gt; *) b. Tagged s b -&gt; b
</span><a href="Data.Binary.Generic.html#unTagged"><span class="hs-identifier hs-var hs-var">unTagged</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Tagged (a :+: b) Word64
forall (f :: * -&gt; *). SumSize f =&gt; Tagged f Word64
</span><a href="Data.Binary.Generic.html#sumSize"><span class="hs-identifier hs-var">sumSize</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Binary.Generic.html#Tagged"><span class="hs-identifier hs-type">Tagged</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679059054"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Generics.html#%3A%2B%3A"><span class="hs-operator hs-type">:+:</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059053"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word64"><span class="hs-identifier hs-type">Word64</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-96"></span><span>
</span><span id="line-97"></span><span id="local-6989586621679059028"><span id="local-6989586621679059029"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="Data.Binary.Generic.html#GSumGet"><span class="hs-identifier hs-type">GSumGet</span></a></span><span>  </span><span class="annot"><a href="#local-6989586621679059029"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Generic.html#GSumGet"><span class="hs-identifier hs-type">GSumGet</span></a></span><span>  </span><span class="annot"><a href="#local-6989586621679059028"><span class="hs-identifier hs-type">b</span></a></span><span>
</span><span id="line-98"></span><span>         </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Generic.html#SumSize"><span class="hs-identifier hs-type">SumSize</span></a></span><span>    </span><span class="annot"><a href="#local-6989586621679059029"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Generic.html#SumSize"><span class="hs-identifier hs-type">SumSize</span></a></span><span>    </span><span class="annot"><a href="#local-6989586621679059028"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Class.html#GBinaryGet"><span class="hs-identifier hs-type">GBinaryGet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679059029"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Generics.html#%3A%2B%3A"><span class="hs-operator hs-type">:+:</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059028"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-99"></span><span>    </span><span id="local-6989586621679058729"><span class="annot"><span class="annottext">gget :: forall t. Get ((:+:) a b t)
</span><a href="#local-6989586621679058729"><span class="hs-identifier hs-var hs-var hs-var hs-var">gget</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">GETSUM</span><span class="hs-special">(</span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">GETSUM</span><span class="hs-special">(</span><span class="hs-identifier">Word16</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">GETSUM</span><span class="hs-special">(</span><span class="hs-identifier">Word32</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">GETSUM</span><span class="hs-special">(</span><span class="hs-identifier">Word64</span><span class="hs-special">)</span><span>
</span><span id="line-100"></span><span>         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Word64 -&gt; Get ((:+:) a b t)
forall size error. Show size =&gt; String -&gt; size -&gt; error
</span><a href="Data.Binary.Generic.html#sizeError"><span class="hs-identifier hs-var">sizeError</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;decode&quot;</span></span><span> </span><span class="annot"><span class="annottext">Word64
</span><a href="#local-6989586621679058728"><span class="hs-identifier hs-var">size</span></a></span><span>
</span><span id="line-101"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-102"></span><span>        </span><span id="local-6989586621679058728"><span class="annot"><span class="annottext">size :: Word64
</span><a href="#local-6989586621679058728"><span class="hs-identifier hs-var hs-var">size</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Tagged (a :+: b) Word64 -&gt; Word64
forall (s :: * -&gt; *) b. Tagged s b -&gt; b
</span><a href="Data.Binary.Generic.html#unTagged"><span class="hs-identifier hs-var hs-var">unTagged</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Tagged (a :+: b) Word64
forall (f :: * -&gt; *). SumSize f =&gt; Tagged f Word64
</span><a href="Data.Binary.Generic.html#sumSize"><span class="hs-identifier hs-var">sumSize</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Binary.Generic.html#Tagged"><span class="hs-identifier hs-type">Tagged</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679059029"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Generics.html#%3A%2B%3A"><span class="hs-operator hs-type">:+:</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059028"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word64"><span class="hs-identifier hs-type">Word64</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-103"></span><span>
</span><span id="line-104"></span><span id="local-6989586621679059039"><span id="local-6989586621679059040"><span class="annot"><a href="Data.Binary.Generic.html#sizeError"><span class="hs-identifier hs-type">sizeError</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059040"><span class="hs-identifier hs-type">size</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059040"><span class="hs-identifier hs-type">size</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059039"><span class="hs-identifier hs-type">error</span></a></span></span></span><span>
</span><span id="line-105"></span><span id="sizeError"><span class="annot"><span class="annottext">sizeError :: forall size error. Show size =&gt; String -&gt; size -&gt; error
</span><a href="Data.Binary.Generic.html#sizeError"><span class="hs-identifier hs-var hs-var">sizeError</span></a></span></span><span> </span><span id="local-6989586621679058719"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679058719"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679058718"><span class="annot"><span class="annottext">size
</span><a href="#local-6989586621679058718"><span class="hs-identifier hs-var">size</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-106"></span><span>    </span><span class="annot"><span class="annottext">String -&gt; error
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; error) -&gt; String -&gt; error
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Can't &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679058719"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; a type with &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">size -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">size
</span><a href="#local-6989586621679058718"><span class="hs-identifier hs-var">size</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; constructors&quot;</span></span><span>
</span><span id="line-107"></span><span>
</span><span id="line-108"></span><span class="hs-comment">------------------------------------------------------------------------</span><span>
</span><span id="line-109"></span><span>
</span><span id="line-110"></span><span id="local-6989586621679059020"><span id="local-6989586621679059021"><span id="local-6989586621679059022"><span class="annot"><a href="Data.Binary.Generic.html#checkGetSum"><span class="hs-identifier hs-type">checkGetSum</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Ord</span></span><span> </span><span class="annot"><a href="#local-6989586621679059022"><span class="hs-identifier hs-type">word</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Num.html#Num"><span class="hs-identifier hs-type">Num</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059022"><span class="hs-identifier hs-type">word</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Bits.html#Bits"><span class="hs-identifier hs-type">Bits</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059022"><span class="hs-identifier hs-type">word</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Generic.html#GSumGet"><span class="hs-identifier hs-type">GSumGet</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059021"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-111"></span><span>            </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059022"><span class="hs-identifier hs-type">word</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059022"><span class="hs-identifier hs-type">word</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679059021"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059020"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-112"></span><span id="checkGetSum"><span class="annot"><span class="annottext">checkGetSum :: forall word (f :: * -&gt; *) a.
(Ord word, Num word, Bits word, GSumGet f) =&gt;
word -&gt; word -&gt; Get (f a)
</span><a href="Data.Binary.Generic.html#checkGetSum"><span class="hs-identifier hs-var hs-var">checkGetSum</span></a></span></span><span> </span><span id="local-6989586621679058704"><span class="annot"><span class="annottext">word
</span><a href="#local-6989586621679058704"><span class="hs-identifier hs-var">size</span></a></span></span><span> </span><span id="local-6989586621679058703"><span class="annot"><span class="annottext">word
</span><a href="#local-6989586621679058703"><span class="hs-identifier hs-var">code</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">word
</span><a href="#local-6989586621679058703"><span class="hs-identifier hs-var">code</span></a></span><span> </span><span class="annot"><span class="annottext">word -&gt; word -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;</span></span><span> </span><span class="annot"><span class="annottext">word
</span><a href="#local-6989586621679058704"><span class="hs-identifier hs-var">size</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">word -&gt; word -&gt; Get (f a)
forall (f :: * -&gt; *) word a.
(GSumGet f, Ord word, Num word, Bits word) =&gt;
word -&gt; word -&gt; Get (f a)
</span><a href="Data.Binary.Generic.html#getSum"><span class="hs-identifier hs-var">getSum</span></a></span><span> </span><span class="annot"><span class="annottext">word
</span><a href="#local-6989586621679058703"><span class="hs-identifier hs-var">code</span></a></span><span> </span><span class="annot"><span class="annottext">word
</span><a href="#local-6989586621679058704"><span class="hs-identifier hs-var">size</span></a></span><span>
</span><span id="line-113"></span><span>                      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Get (f a)
forall (m :: * -&gt; *) a. MonadFail m =&gt; String -&gt; m a
</span><a href="../../base/src/Control.Monad.Fail.html#fail"><span class="hs-identifier hs-var">fail</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Unknown encoding for constructor&quot;</span></span><span>
</span><span id="line-114"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Binary.Generic.html#checkGetSum"><span class="hs-pragma hs-type">checkGetSum</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-115"></span><span>
</span><span id="line-116"></span><span class="hs-keyword">class</span><span> </span><span id="GSumGet"><span class="annot"><a href="Data.Binary.Generic.html#GSumGet"><span class="hs-identifier hs-var">GSumGet</span></a></span></span><span> </span><span id="local-6989586621679059007"><span class="annot"><a href="#local-6989586621679059007"><span class="hs-identifier hs-type">f</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-117"></span><span>    </span><span id="local-6989586621679059005"><span id="local-6989586621679059006"><span id="getSum"><span class="annot"><a href="Data.Binary.Generic.html#getSum"><span class="hs-identifier hs-type">getSum</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Ord</span></span><span> </span><span class="annot"><a href="#local-6989586621679059006"><span class="hs-identifier hs-type">word</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Num.html#Num"><span class="hs-identifier hs-type">Num</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059006"><span class="hs-identifier hs-type">word</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Bits.html#Bits"><span class="hs-identifier hs-type">Bits</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059006"><span class="hs-identifier hs-type">word</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059006"><span class="hs-identifier hs-type">word</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059006"><span class="hs-identifier hs-type">word</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679059007"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059005"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-118"></span><span>
</span><span id="line-119"></span><span class="hs-keyword">class</span><span> </span><span id="GSumPut"><span class="annot"><a href="Data.Binary.Generic.html#GSumPut"><span class="hs-identifier hs-var">GSumPut</span></a></span></span><span> </span><span id="local-6989586621679059043"><span class="annot"><a href="#local-6989586621679059043"><span class="hs-identifier hs-type">f</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-120"></span><span>    </span><span id="local-6989586621679059041"><span id="local-6989586621679059042"><span id="putSum"><span class="annot"><a href="Data.Binary.Generic.html#putSum"><span class="hs-identifier hs-type">putSum</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Num.html#Num"><span class="hs-identifier hs-type">Num</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059042"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Bits.html#Bits"><span class="hs-identifier hs-type">Bits</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059042"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Class.html#Binary"><span class="hs-identifier hs-type">Binary</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059042"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059042"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059042"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679059043"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059041"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Put.html#Put"><span class="hs-identifier hs-type">Put</span></a></span></span></span><span>
</span><span id="line-121"></span><span>
</span><span id="line-122"></span><span id="local-6989586621679059026"><span id="local-6989586621679059027"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Binary.Generic.html#GSumGet"><span class="hs-identifier hs-type">GSumGet</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059027"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Generic.html#GSumGet"><span class="hs-identifier hs-type">GSumGet</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059026"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Generic.html#GSumGet"><span class="hs-identifier hs-type">GSumGet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679059027"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Generics.html#%3A%2B%3A"><span class="hs-operator hs-type">:+:</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059026"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-123"></span><span>    </span><span id="local-6989586621679058681"><span class="annot"><span class="annottext">getSum :: forall word a.
(Ord word, Num word, Bits word) =&gt;
word -&gt; word -&gt; Get ((:+:) a b a)
</span><a href="#local-6989586621679058681"><span class="hs-identifier hs-var hs-var hs-var hs-var">getSum</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679058680"><span class="annot"><span class="annottext">word
</span><a href="#local-6989586621679058680"><span class="hs-identifier hs-var">code</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679058679"><span class="annot"><span class="annottext">word
</span><a href="#local-6989586621679058679"><span class="hs-identifier hs-var">size</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">word
</span><a href="#local-6989586621679058680"><span class="hs-identifier hs-var">code</span></a></span><span> </span><span class="annot"><span class="annottext">word -&gt; word -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;</span></span><span> </span><span class="annot"><span class="annottext">word
</span><a href="#local-6989586621679058678"><span class="hs-identifier hs-var">sizeL</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a a -&gt; (:+:) a b a
forall k (f :: k -&gt; *) (g :: k -&gt; *) (p :: k). f p -&gt; (:+:) f g p
</span><a href="../../base/src/GHC.Generics.html#L1"><span class="hs-identifier hs-var">L1</span></a></span><span> </span><span class="annot"><span class="annottext">(a a -&gt; (:+:) a b a) -&gt; Get (a a) -&gt; Get ((:+:) a b a)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">word -&gt; word -&gt; Get (a a)
forall (f :: * -&gt; *) word a.
(GSumGet f, Ord word, Num word, Bits word) =&gt;
word -&gt; word -&gt; Get (f a)
</span><a href="Data.Binary.Generic.html#getSum"><span class="hs-identifier hs-var">getSum</span></a></span><span> </span><span class="annot"><span class="annottext">word
</span><a href="#local-6989586621679058680"><span class="hs-identifier hs-var">code</span></a></span><span>           </span><span class="annot"><span class="annottext">word
</span><a href="#local-6989586621679058678"><span class="hs-identifier hs-var">sizeL</span></a></span><span>
</span><span id="line-124"></span><span>                       </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b a -&gt; (:+:) a b a
forall k (f :: k -&gt; *) (g :: k -&gt; *) (p :: k). g p -&gt; (:+:) f g p
</span><a href="../../base/src/GHC.Generics.html#R1"><span class="hs-identifier hs-var">R1</span></a></span><span> </span><span class="annot"><span class="annottext">(b a -&gt; (:+:) a b a) -&gt; Get (b a) -&gt; Get ((:+:) a b a)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">word -&gt; word -&gt; Get (b a)
forall (f :: * -&gt; *) word a.
(GSumGet f, Ord word, Num word, Bits word) =&gt;
word -&gt; word -&gt; Get (f a)
</span><a href="Data.Binary.Generic.html#getSum"><span class="hs-identifier hs-var">getSum</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">word
</span><a href="#local-6989586621679058680"><span class="hs-identifier hs-var">code</span></a></span><span> </span><span class="annot"><span class="annottext">word -&gt; word -&gt; word
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">word
</span><a href="#local-6989586621679058678"><span class="hs-identifier hs-var">sizeL</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">word
</span><a href="#local-6989586621679058675"><span class="hs-identifier hs-var">sizeR</span></a></span><span>
</span><span id="line-125"></span><span>        </span><span class="hs-keyword">where</span><span>
</span><span id="line-126"></span><span>          </span><span id="local-6989586621679058678"><span class="annot"><span class="annottext">sizeL :: word
</span><a href="#local-6989586621679058678"><span class="hs-identifier hs-var hs-var">sizeL</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">word
</span><a href="#local-6989586621679058679"><span class="hs-identifier hs-var">size</span></a></span><span> </span><span class="annot"><span class="annottext">word -&gt; Int -&gt; word
forall a. Bits a =&gt; a -&gt; Int -&gt; a
</span><a href="../../base/src/Data.Bits.html#shiftR"><span class="hs-operator hs-var">`shiftR`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-127"></span><span>          </span><span id="local-6989586621679058675"><span class="annot"><span class="annottext">sizeR :: word
</span><a href="#local-6989586621679058675"><span class="hs-identifier hs-var hs-var">sizeR</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">word
</span><a href="#local-6989586621679058679"><span class="hs-identifier hs-var">size</span></a></span><span> </span><span class="annot"><span class="annottext">word -&gt; word -&gt; word
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">word
</span><a href="#local-6989586621679058678"><span class="hs-identifier hs-var">sizeL</span></a></span></span></span><span>
</span><span id="line-128"></span><span>
</span><span id="line-129"></span><span id="local-6989586621679059050"><span id="local-6989586621679059051"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Binary.Generic.html#GSumPut"><span class="hs-identifier hs-type">GSumPut</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059051"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Generic.html#GSumPut"><span class="hs-identifier hs-type">GSumPut</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059050"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Generic.html#GSumPut"><span class="hs-identifier hs-type">GSumPut</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679059051"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Generics.html#%3A%2B%3A"><span class="hs-operator hs-type">:+:</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059050"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-130"></span><span>    </span><span id="local-6989586621679058655"><span class="annot"><span class="annottext">putSum :: forall w a.
(Num w, Bits w, Binary w) =&gt;
w -&gt; w -&gt; (:+:) a b a -&gt; Put
</span><a href="#local-6989586621679058655"><span class="hs-identifier hs-var hs-var hs-var hs-var">putSum</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679058654"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679058654"><span class="hs-identifier hs-var">code</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679058653"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679058653"><span class="hs-identifier hs-var">size</span></a></span></span><span> </span><span id="local-6989586621679058652"><span class="annot"><span class="annottext">(:+:) a b a
</span><a href="#local-6989586621679058652"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">(:+:) a b a
</span><a href="#local-6989586621679058652"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-131"></span><span>                             </span><span class="annot"><a href="../../base/src/GHC.Generics.html#L1"><span class="hs-identifier hs-type">L1</span></a></span><span> </span><span id="local-6989586621679058651"><span class="annot"><span class="annottext">a a
</span><a href="#local-6989586621679058651"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">w -&gt; w -&gt; a a -&gt; Put
forall (f :: * -&gt; *) w a.
(GSumPut f, Num w, Bits w, Binary w) =&gt;
w -&gt; w -&gt; f a -&gt; Put
</span><a href="Data.Binary.Generic.html#putSum"><span class="hs-identifier hs-var">putSum</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679058654"><span class="hs-identifier hs-var">code</span></a></span><span>           </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679058650"><span class="hs-identifier hs-var">sizeL</span></a></span><span> </span><span class="annot"><span class="annottext">a a
</span><a href="#local-6989586621679058651"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-132"></span><span>                             </span><span class="annot"><a href="../../base/src/GHC.Generics.html#R1"><span class="hs-identifier hs-type">R1</span></a></span><span> </span><span id="local-6989586621679058649"><span class="annot"><span class="annottext">b a
</span><a href="#local-6989586621679058649"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">w -&gt; w -&gt; b a -&gt; Put
forall (f :: * -&gt; *) w a.
(GSumPut f, Num w, Bits w, Binary w) =&gt;
w -&gt; w -&gt; f a -&gt; Put
</span><a href="Data.Binary.Generic.html#putSum"><span class="hs-identifier hs-var">putSum</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679058654"><span class="hs-identifier hs-var">code</span></a></span><span> </span><span class="annot"><span class="annottext">w -&gt; w -&gt; w
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679058650"><span class="hs-identifier hs-var">sizeL</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679058647"><span class="hs-identifier hs-var">sizeR</span></a></span><span> </span><span class="annot"><span class="annottext">b a
</span><a href="#local-6989586621679058649"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-133"></span><span>        </span><span class="hs-keyword">where</span><span>
</span><span id="line-134"></span><span>          </span><span id="local-6989586621679058650"><span class="annot"><span class="annottext">sizeL :: w
</span><a href="#local-6989586621679058650"><span class="hs-identifier hs-var hs-var">sizeL</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679058653"><span class="hs-identifier hs-var">size</span></a></span><span> </span><span class="annot"><span class="annottext">w -&gt; Int -&gt; w
forall a. Bits a =&gt; a -&gt; Int -&gt; a
</span><a href="../../base/src/Data.Bits.html#shiftR"><span class="hs-operator hs-var">`shiftR`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-135"></span><span>          </span><span id="local-6989586621679058647"><span class="annot"><span class="annottext">sizeR :: w
</span><a href="#local-6989586621679058647"><span class="hs-identifier hs-var hs-var">sizeR</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679058653"><span class="hs-identifier hs-var">size</span></a></span><span> </span><span class="annot"><span class="annottext">w -&gt; w -&gt; w
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679058650"><span class="hs-identifier hs-var">sizeL</span></a></span></span></span><span>
</span><span id="line-136"></span><span>
</span><span id="line-137"></span><span id="local-6989586621679058986"><span id="local-6989586621679058987"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Data.Binary.Class.html#GBinaryGet"><span class="hs-identifier hs-type">GBinaryGet</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058987"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Generic.html#GSumGet"><span class="hs-identifier hs-type">GSumGet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Generics.html#C1"><span class="hs-identifier hs-type">C1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058986"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058987"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-138"></span><span>    </span><span id="local-6989586621679058637"><span class="annot"><span class="annottext">getSum :: forall word a.
(Ord word, Num word, Bits word) =&gt;
word -&gt; word -&gt; Get (C1 c a a)
</span><a href="#local-6989586621679058637"><span class="hs-identifier hs-var hs-var hs-var hs-var">getSum</span></a></span></span><span> </span><span class="annot"><span class="annottext">word
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">word
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Get (M1 C c a a)
forall {k} (f :: k -&gt; *) (t :: k). GBinaryGet f =&gt; Get (f t)
</span><a href="Data.Binary.Class.html#gget"><span class="hs-identifier hs-var">gget</span></a></span></span></span><span>
</span><span id="line-139"></span><span>
</span><span id="line-140"></span><span id="local-6989586621679058980"><span id="local-6989586621679058981"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Data.Binary.Class.html#GBinaryPut"><span class="hs-identifier hs-type">GBinaryPut</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058981"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Generic.html#GSumPut"><span class="hs-identifier hs-type">GSumPut</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Generics.html#C1"><span class="hs-identifier hs-type">C1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058980"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058981"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-141"></span><span>    </span><span id="local-6989586621679058627"><span class="annot"><span class="annottext">putSum :: forall w a. (Num w, Bits w, Binary w) =&gt; w -&gt; w -&gt; C1 c a a -&gt; Put
</span><a href="#local-6989586621679058627"><span class="hs-identifier hs-var hs-var hs-var hs-var">putSum</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679058626"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679058626"><span class="hs-identifier hs-var">code</span></a></span></span><span> </span><span class="annot"><span class="annottext">w
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679058625"><span class="annot"><span class="annottext">C1 c a a
</span><a href="#local-6989586621679058625"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">w -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679058626"><span class="hs-identifier hs-var">code</span></a></span><span> </span><span class="annot"><span class="annottext">Put -&gt; Put -&gt; Put
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">C1 c a a -&gt; Put
forall {k} (f :: k -&gt; *) (t :: k). GBinaryPut f =&gt; f t -&gt; Put
</span><a href="Data.Binary.Class.html#gput"><span class="hs-identifier hs-var">gput</span></a></span><span> </span><span class="annot"><span class="annottext">C1 c a a
</span><a href="#local-6989586621679058625"><span class="hs-identifier hs-var">x</span></a></span></span></span><span>
</span><span id="line-142"></span><span>
</span><span id="line-143"></span><span class="hs-comment">------------------------------------------------------------------------</span><span>
</span><span id="line-144"></span><span>
</span><span id="line-145"></span><span class="hs-keyword">class</span><span> </span><span id="SumSize"><span class="annot"><a href="Data.Binary.Generic.html#SumSize"><span class="hs-identifier hs-var">SumSize</span></a></span></span><span> </span><span id="local-6989586621679059033"><span class="annot"><a href="#local-6989586621679059033"><span class="hs-identifier hs-type">f</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-146"></span><span>    </span><span id="sumSize"><span class="annot"><a href="Data.Binary.Generic.html#sumSize"><span class="hs-identifier hs-type">sumSize</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Binary.Generic.html#Tagged"><span class="hs-identifier hs-type">Tagged</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059033"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word64"><span class="hs-identifier hs-type">Word64</span></a></span><span class="hs-cpp">

#ifdef HAS_DATA_KIND
</span><span class="hs-keyword">newtype</span><span> </span><span id="Tagged"><span class="annot"><a href="Data.Binary.Generic.html#Tagged"><span class="hs-identifier hs-var">Tagged</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679059035"><span class="annot"><a href="#local-6989586621679059035"><span class="hs-identifier hs-type">s</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Type</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Type</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679059034"><span class="annot"><a href="#local-6989586621679059034"><span class="hs-identifier hs-type">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="Tagged"><span class="annot"><a href="Data.Binary.Generic.html#Tagged"><span class="hs-identifier hs-var">Tagged</span></a></span></span><span> </span><span class="hs-special">{</span><span id="unTagged"><span class="annot"><span class="annottext">forall (s :: * -&gt; *) b. Tagged s b -&gt; b
</span><a href="Data.Binary.Generic.html#unTagged"><span class="hs-identifier hs-var hs-var">unTagged</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679059034"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">}</span><span class="hs-cpp">
#else
</span><span class="hs-keyword">newtype</span><span> </span><span class="hs-identifier">Tagged</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">s</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-operator">*</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-operator">*</span><span class="hs-special">)</span><span>       </span><span class="hs-identifier">b</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">Tagged</span><span> </span><span class="hs-special">{</span><span class="hs-identifier">unTagged</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">b</span><span class="hs-special">}</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-154"></span><span id="local-6989586621679059037"><span id="local-6989586621679059038"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Binary.Generic.html#SumSize"><span class="hs-identifier hs-type">SumSize</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059038"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Binary.Generic.html#SumSize"><span class="hs-identifier hs-type">SumSize</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059037"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Data.Binary.Generic.html#SumSize"><span class="hs-identifier hs-type">SumSize</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679059038"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Generics.html#%3A%2B%3A"><span class="hs-operator hs-type">:+:</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059037"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-155"></span><span>    </span><span id="local-6989586621679058616"><span class="annot"><span class="annottext">sumSize :: Tagged (a :+: b) Word64
</span><a href="#local-6989586621679058616"><span class="hs-identifier hs-var hs-var hs-var hs-var">sumSize</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word64 -&gt; Tagged (a :+: b) Word64
forall (s :: * -&gt; *) b. b -&gt; Tagged s b
</span><a href="Data.Binary.Generic.html#Tagged"><span class="hs-identifier hs-var">Tagged</span></a></span><span> </span><span class="annot"><span class="annottext">(Word64 -&gt; Tagged (a :+: b) Word64)
-&gt; Word64 -&gt; Tagged (a :+: b) Word64
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Tagged a Word64 -&gt; Word64
forall (s :: * -&gt; *) b. Tagged s b -&gt; b
</span><a href="Data.Binary.Generic.html#unTagged"><span class="hs-identifier hs-var hs-var">unTagged</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Tagged a Word64
forall (f :: * -&gt; *). SumSize f =&gt; Tagged f Word64
</span><a href="Data.Binary.Generic.html#sumSize"><span class="hs-identifier hs-var">sumSize</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Binary.Generic.html#Tagged"><span class="hs-identifier hs-type">Tagged</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059038"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word64"><span class="hs-identifier hs-type">Word64</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Word64 -&gt; Word64 -&gt; Word64
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span>
</span><span id="line-156"></span><span>                       </span><span class="annot"><span class="annottext">Tagged b Word64 -&gt; Word64
forall (s :: * -&gt; *) b. Tagged s b -&gt; b
</span><a href="Data.Binary.Generic.html#unTagged"><span class="hs-identifier hs-var hs-var">unTagged</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Tagged b Word64
forall (f :: * -&gt; *). SumSize f =&gt; Tagged f Word64
</span><a href="Data.Binary.Generic.html#sumSize"><span class="hs-identifier hs-var">sumSize</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Binary.Generic.html#Tagged"><span class="hs-identifier hs-type">Tagged</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679059037"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word64"><span class="hs-identifier hs-type">Word64</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-157"></span><span>
</span><span id="line-158"></span><span id="local-6989586621679058970"><span id="local-6989586621679058971"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Data.Binary.Generic.html#SumSize"><span class="hs-identifier hs-type">SumSize</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Generics.html#C1"><span class="hs-identifier hs-type">C1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058971"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679058970"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-159"></span><span>    </span><span id="local-6989586621679058612"><span class="annot"><span class="annottext">sumSize :: Tagged (C1 c a) Word64
</span><a href="#local-6989586621679058612"><span class="hs-identifier hs-var hs-var hs-var hs-var">sumSize</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word64 -&gt; Tagged (C1 c a) Word64
forall (s :: * -&gt; *) b. b -&gt; Tagged s b
</span><a href="Data.Binary.Generic.html#Tagged"><span class="hs-identifier hs-var">Tagged</span></a></span><span> </span><span class="annot"><span class="annottext">Word64
</span><span class="hs-number">1</span></span></span></span><span>
</span><span id="line-160"></span></pre></body></html>